package org.jeecg.modules.demo.projectroom.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import liquibase.pro.packaged.L;
import org.jeecg.modules.demo.projectroom.entity.ZnzfRoom;
import org.jeecg.modules.demo.projectroom.mapper.ZnzfRoomMapper;
import org.jeecg.modules.demo.projectroom.service.IZnzfRoomService;
import org.springframework.stereotype.Service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Description: 房源表
 * @Author: jeecg-boot
 * @Date:   2022-04-09
 * @Version: V1.0
 */
@Service
public class ZnzfRoomServiceImpl extends ServiceImpl<ZnzfRoomMapper, ZnzfRoom> implements IZnzfRoomService {
	
	@Autowired
	private ZnzfRoomMapper znzfRoomMapper;
	
	@Override
	public List<ZnzfRoom> selectByMainId(String mainId) {
		return znzfRoomMapper.selectByMainId(mainId);
	}

	@Override
	public List<ZnzfRoom> searchsByProjectId(String projectId) {
		LambdaQueryWrapper<ZnzfRoom> queryWrapper = new LambdaQueryWrapper<>();
		queryWrapper.eq(ZnzfRoom::getProjectId, projectId);
		return znzfRoomMapper.selectList(queryWrapper);
	}

	@Override
	public ZnzfRoom findByRoomId(String roomId) {
		LambdaQueryWrapper<ZnzfRoom> queryWrapper = new LambdaQueryWrapper<>();
		queryWrapper.eq(ZnzfRoom::getId, roomId);
		return znzfRoomMapper.selectOne(queryWrapper);
	}
}
